package com.ssh.entity;

import java.io.Serializable;

/**
 * 购物项
 * @author ASUS
 *
 */
public class CartItem implements Serializable {

	private static final long serialVersionUID = 2399352259107712676L;

	// 商品
	private Product product;
	
	// 小计
	@SuppressWarnings("unused")
	private Double subtotal;
	
	//数量
	private Integer count;
	
	public CartItem() {}
	
	public CartItem(Product product, Integer count) {
		this.product = product;
		this.count = count;
	}

	public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	public Double getSubtotal() {
		return subtotal = product.getPrice()*this.count;
	}

	/*public void setSubtotal(Double subtotal) {
		this.subtotal = subtotal;
	}*/

	public Integer getCount() {
		return count;
	}

	public void setCount(Integer count) {
		this.count = count;
	}


}
